<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__cryptolite__lld__rng__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__cryptolite.html">Cryptolite   (Cryptography)</a> &raquo; <a class="el" href="group__group__cryptolite__lld__random__number.html">Random Number Generation(TRNG)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga23d7ac89923599bdcf88a1c2214af059"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a> (CRYPTOLITE_Type *base, uint32_t *randomNum)</td></tr>
<tr class="memdesc:ga23d7ac89923599bdcf88a1c2214af059"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a True Random Number.  <a href="#ga23d7ac89923599bdcf88a1c2214af059">More...</a><br /></td></tr>
<tr class="separator:ga23d7ac89923599bdcf88a1c2214af059"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3c17326a41706e675bacbfd5d1cc94d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a> (CRYPTOLITE_Type *base, <a class="el" href="structcy__stc__cryptolite__trng__config__t.html">cy_stc_cryptolite_trng_config_t</a> *config)</td></tr>
<tr class="memdesc:gac3c17326a41706e675bacbfd5d1cc94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the TRNG hardware submodule.  <a href="#gac3c17326a41706e675bacbfd5d1cc94d">More...</a><br /></td></tr>
<tr class="separator:gac3c17326a41706e675bacbfd5d1cc94d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad5abe4fa4f0d0d93f4592517d6770a34"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#gad5abe4fa4f0d0d93f4592517d6770a34">Cy_Cryptolite_Trng_Enable</a> (CRYPTOLITE_Type *base)</td></tr>
<tr class="memdesc:gad5abe4fa4f0d0d93f4592517d6770a34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a random number generation.  <a href="#gad5abe4fa4f0d0d93f4592517d6770a34">More...</a><br /></td></tr>
<tr class="separator:gad5abe4fa4f0d0d93f4592517d6770a34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga00b040dab7db91270015e66ab4bc2b7f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#ga00b040dab7db91270015e66ab4bc2b7f">Cy_Cryptolite_Trng_Disable</a> (CRYPTOLITE_Type *base)</td></tr>
<tr class="memdesc:ga00b040dab7db91270015e66ab4bc2b7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the random number generation.  <a href="#ga00b040dab7db91270015e66ab4bc2b7f">More...</a><br /></td></tr>
<tr class="separator:ga00b040dab7db91270015e66ab4bc2b7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga755e5f5b8c26eadacb92ba16934558c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#ga755e5f5b8c26eadacb92ba16934558c7">Cy_Cryptolite_Trng_ReadData</a> (CRYPTOLITE_Type *base, uint32_t *randomData)</td></tr>
<tr class="memdesc:ga755e5f5b8c26eadacb92ba16934558c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads in blocking mode a generated random number.  <a href="#ga755e5f5b8c26eadacb92ba16934558c7">More...</a><br /></td></tr>
<tr class="separator:ga755e5f5b8c26eadacb92ba16934558c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac604a8f454e8de5d320a5077075a055b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a> (CRYPTOLITE_Type *base)</td></tr>
<tr class="memdesc:gac604a8f454e8de5d320a5077075a055b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all TRNG registers by set to hardware default values.  <a href="#gac604a8f454e8de5d320a5077075a055b">More...</a><br /></td></tr>
<tr class="separator:gac604a8f454e8de5d320a5077075a055b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0303ca1836bdc5c9bdaa4b95fc23b07"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__cryptolite__lld__rng__functions.html#gab0303ca1836bdc5c9bdaa4b95fc23b07">Cy_Cryptolite_Trng_IsEnabled</a> (CRYPTOLITE_Type *base)</td></tr>
<tr class="memdesc:gab0303ca1836bdc5c9bdaa4b95fc23b07"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if Trng is enabled.  <a href="#gab0303ca1836bdc5c9bdaa4b95fc23b07">More...</a><br /></td></tr>
<tr class="separator:gab0303ca1836bdc5c9bdaa4b95fc23b07"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga23d7ac89923599bdcf88a1c2214af059"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga23d7ac89923599bdcf88a1c2214af059">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> Cy_Cryptolite_Trng </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generates a True Random Number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the cryptolite instance.</td></tr>
    <tr><td class="paramname">randomNum</td><td>The pointer to a generated true random number.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gac3c17326a41706e675bacbfd5d1cc94d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3c17326a41706e675bacbfd5d1cc94d">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> Cy_Cryptolite_Trng_Init </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__cryptolite__trng__config__t.html">cy_stc_cryptolite_trng_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the TRNG hardware submodule. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTOLITE instance.</td></tr>
    <tr><td class="paramname">config</td><td>The pointer to the configuration structure. If NULL default config is used.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gad5abe4fa4f0d0d93f4592517d6770a34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad5abe4fa4f0d0d93f4592517d6770a34">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng_Enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> Cy_Cryptolite_Trng_Enable </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts a random number generation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTOLITE instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The error / status code. See <a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gad5abe4fa4f0d0d93f4592517d6770a34">Cy_Cryptolite_Trng_Enable</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gab0303ca1836bdc5c9bdaa4b95fc23b07">Cy_Cryptolite_Trng_IsEnabled</a>() == <span class="keyword">true</span>)</div><div class="line">    {</div><div class="line">        status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga755e5f5b8c26eadacb92ba16934558c7">Cy_Cryptolite_Trng_ReadData</a>(CRYPTOLITE, &amp;randomNum);</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga00b040dab7db91270015e66ab4bc2b7f">Cy_Cryptolite_Trng_Disable</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga00b040dab7db91270015e66ab4bc2b7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga00b040dab7db91270015e66ab4bc2b7f">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng_Disable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> Cy_Cryptolite_Trng_Disable </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stops the random number generation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTOLITE instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The error / status code. See <a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gad5abe4fa4f0d0d93f4592517d6770a34">Cy_Cryptolite_Trng_Enable</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gab0303ca1836bdc5c9bdaa4b95fc23b07">Cy_Cryptolite_Trng_IsEnabled</a>() == <span class="keyword">true</span>)</div><div class="line">    {</div><div class="line">        status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga755e5f5b8c26eadacb92ba16934558c7">Cy_Cryptolite_Trng_ReadData</a>(CRYPTOLITE, &amp;randomNum);</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga00b040dab7db91270015e66ab4bc2b7f">Cy_Cryptolite_Trng_Disable</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga755e5f5b8c26eadacb92ba16934558c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga755e5f5b8c26eadacb92ba16934558c7">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng_ReadData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> Cy_Cryptolite_Trng_ReadData </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>randomData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads in blocking mode a generated random number. </p>
<dl class="section note"><dt>Note</dt><dd>Call this API only after <a class="el" href="group__group__cryptolite__lld__rng__functions.html#gad5abe4fa4f0d0d93f4592517d6770a34" title="Starts a random number generation. ">Cy_Cryptolite_Trng_Enable()</a> is successful.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTO instance.</td></tr>
    <tr><td class="paramname">randomData</td><td>The pointer to a generated true random number.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The error / status code. See <a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gac604a8f454e8de5d320a5077075a055b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac604a8f454e8de5d320a5077075a055b">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> Cy_Cryptolite_Trng_DeInit </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears all TRNG registers by set to hardware default values. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTOLITE instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The error / status code. See <a class="el" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gab0303ca1836bdc5c9bdaa4b95fc23b07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab0303ca1836bdc5c9bdaa4b95fc23b07">&#9670;&nbsp;</a></span>Cy_Cryptolite_Trng_IsEnabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Cy_Cryptolite_Trng_IsEnabled </td>
          <td>(</td>
          <td class="paramtype">CRYPTOLITE_Type *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if Trng is enabled. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the CRYPTOLITE instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The 'true' if Trng enabled 'false' otherwise.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t random_val;</div><div class="line">    <a class="code" href="group__group__cryptolite__enums.html#gafaeb3f2fb88784222220aee907e36710">cy_en_cryptolite_status_t</a> status;</div><div class="line"></div><div class="line">    <span class="comment">/*Init TRNG with default config*/</span></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac3c17326a41706e675bacbfd5d1cc94d">Cy_Cryptolite_Trng_Init</a>(CRYPTOLITE, NULL);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#gad5abe4fa4f0d0d93f4592517d6770a34">Cy_Cryptolite_Trng_Enable</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gab0303ca1836bdc5c9bdaa4b95fc23b07">Cy_Cryptolite_Trng_IsEnabled</a>() == <span class="keyword">true</span>)</div><div class="line">    {</div><div class="line">        status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga755e5f5b8c26eadacb92ba16934558c7">Cy_Cryptolite_Trng_ReadData</a>(CRYPTOLITE, &amp;randomNum);</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga00b040dab7db91270015e66ab4bc2b7f">Cy_Cryptolite_Trng_Disable</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__cryptolite__lld__rng__functions.html#ga23d7ac89923599bdcf88a1c2214af059">Cy_Cryptolite_Trng</a>(CRYPTOLITE, &amp;random_val);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div><div class="line">    status =<a class="code" href="group__group__cryptolite__lld__rng__functions.html#gac604a8f454e8de5d320a5077075a055b">Cy_Cryptolite_Trng_DeInit</a>(CRYPTOLITE);</div><div class="line"></div><div class="line">    <span class="comment">/* ... check for errors... */</span></div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
